package com.my.demo.controller;

import com.baomidou.mybatisplus.extension.api.R;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;


@RestController
@Api("test")
public class TestUpload {


    @ApiOperation("ttt")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "title", value = "标题", required = true, dataType = "String",  paramType = "query"),
    })
    @PostMapping(value = "/contribution",consumes = "multipart/*",headers = "content-type=multipart/form-data")
    public void upload(HttpServletRequest request, @ApiParam(name = "file",value = "文件") MultipartFile file, @RequestParam String title) {

            System.out.println(file.getName());

    }
}
